package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TActivityRegisterMapper;
import com.ruoyi.system.domain.TActivityRegister;
import com.ruoyi.system.service.ITActivityRegisterService;

/**
 * 活动报名登记Service业务层处理
 * 
 * @author xiyu
 * @date 2024-12-01
 */
@Service
public class TActivityRegisterServiceImpl implements ITActivityRegisterService 
{
    @Autowired
    private TActivityRegisterMapper tActivityRegisterMapper;

    /**
     * 查询活动报名登记
     * 
     * @param id 活动报名登记主键
     * @return 活动报名登记
     */
    @Override
    public TActivityRegister selectTActivityRegisterById(Long id)
    {
        return tActivityRegisterMapper.selectTActivityRegisterById(id);
    }

    /**
     * 查询活动报名登记列表
     * 
     * @param tActivityRegister 活动报名登记
     * @return 活动报名登记
     */
    @Override
    public List<TActivityRegister> selectTActivityRegisterList(TActivityRegister tActivityRegister)
    {
        return tActivityRegisterMapper.selectTActivityRegisterList(tActivityRegister);
    }

    /**
     * 新增活动报名登记
     * 
     * @param tActivityRegister 活动报名登记
     * @return 结果
     */
    @Override
    public int insertTActivityRegister(TActivityRegister tActivityRegister)
    {
        tActivityRegister.setCreateTime(DateUtils.getNowDate());
        return tActivityRegisterMapper.insertTActivityRegister(tActivityRegister);
    }

    /**
     * 修改活动报名登记
     * 
     * @param tActivityRegister 活动报名登记
     * @return 结果
     */
    @Override
    public int updateTActivityRegister(TActivityRegister tActivityRegister)
    {
        tActivityRegister.setUpdateTime(DateUtils.getNowDate());
        return tActivityRegisterMapper.updateTActivityRegister(tActivityRegister);
    }

    /**
     * 批量删除活动报名登记
     * 
     * @param ids 需要删除的活动报名登记主键
     * @return 结果
     */
    @Override
    public int deleteTActivityRegisterByIds(Long[] ids, String rewardStatus)
    {
        return tActivityRegisterMapper.updateRegisterStatusByIds(ids, rewardStatus);
//        return tActivityRegisterMapper.deleteTActivityRegisterByIds(ids);
    }

    /**
     * 删除活动报名登记信息
     * 
     * @param id 活动报名登记主键
     * @return 结果
     */
    @Override
    public int deleteTActivityRegisterById(Long id)
    {
        return tActivityRegisterMapper.deleteTActivityRegisterById(id);
    }
}
